<?xml version="1.0" encoding="UTF-8" ?>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
	xmlns:ui="http://java.sun.com/jsf/facelets"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:f="http://java.sun.com/jsf/core"
	xmlns:p="http://primefaces.org/ui">

<ui:composition template="/public/template.xhtml">
	<ui:define name="conteudo">
	
						
			<h:form>
			
			<p:growl id="messages" showDetail="true" autoUpdate="true" closable="true" />
			<h:panelGrid columns="2">
			
			
			<h:outputText value="Título"/>
			<p:inputText value="#{eventosMB.evento.nome}" required="true"/> 
			
			<h:outputText value="Descrição"/>		
			<p:editor id="editor" value="#{eventosMB.evento.descricao}" width="600"/>
				
			<h:outputText value="Submisão de Trabalhos"/>		
			<p:calendar value="#{eventosMB.evento.dataInicial}" id="popupButtonCal" showOn="button" />  
				<h:panelGrid id="display" columns="2" cellpadding="5">  
					 <h:outputText value="#{eventosMB.evento.dataInicial}">  
						 <f:convertDateTime pattern="d/M/yyyy"/>  
			 </h:outputText>  
			 </h:panelGrid>  
				<p:calendar value="#{eventosMB.evento.dataFinal}" id="popupButtonCalendar" showOn="button" />  				      
					<h:panelGrid id="display2" columns="3" cellpadding="5">  			            
						<h:outputText value="#{eventosMB.evento.dataFinal}">  
						     <f:convertDateTime pattern="d/M/yyyy"/>  
						 </h:outputText>         
					</h:panelGrid>  

			<h:outputText value="Gratuito"/>
			<input type="checkbox" id="checkBox" value="#{eventosMB.evento.gratuito}" onclick="enableDisable(this.checked, 'textBox')"/>
<!-- 							<td><h:selectBooleanCheckbox value="#{eventosMB.evento.gratuito}" onclick="enableDisable(!this.checked, 'textBox')"/><br/></td> -->
<!-- 						<h:inputText disabled="#{!bean.permissionToWrite}"></h:inputText> -->
						
						   
						
<!-- 					Fazer verificação se o boolean gratuito for true dá um hide no valor -->
			<h:outputText value="Valor"/>
				<input type="text" id="textBox" value="#{eventosMB.evento.valor}"/>
<!-- 							<td><p:inputText value="#{eventosMB.evento.valor}" required="true" id="texto"/> <br/></td> -->
						
						<h:commandButton action="#{eventosMB.cadastrarEvento}" value="Salvar" />
			
			</h:panelGrid>
		</h:form>
		
</ui:define>
</ui:composition>
</html>